<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
use think\Url;
use app\index\model\Menu;
use app\index\model\prodUser;
// use app\index\model\Test;
use app\index\model\authRule;
use app\index\model\User;

class Test extends Controller
{
    public function index(){

    }

    public function testVerify(){
    	// $username = $this->request->param('username');
    	// var_dump($username);
        
    	/**
    	 * 5.0自动验证
    	 */
    	if(@$_POST['submit'] == '提交'){
    		$user = new User;
	    	if($user->allowField(true)->validate(true)->save(input('post.'))){
	    		echo 'success!!';
	    	}else{
	    		return $user->getError();
	    	}

	    	p($user);
    	}else{
    		// return $this->fetch();
	        //一个意思
	        return view();
    	}
        
    }
}